apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
  name: gadget
spec:
  version: {{ .TagName }}
  homepage: https://github.com/inspektor-gadget/inspektor-gadget
  shortDescription: Gadgets for debugging and introspecting apps
  description: |
    Inspektor Gadget is a collection of tools (or gadgets) to debug and inspect
    Kubernetes resources and applications. It manages the packaging, deployment
    and execution of eBPF programs in a Kubernetes cluster, including many based
    on BCC tools, as well as some developed specifically for use in Inspektor
    Gadget. It automatically maps low-level kernel primitives to high-level
    Kubernetes resources, making it easier and quicker to find the relevant
    information.

    Inspektor Gadget is deployed to each node as a privileged DaemonSet.
    It uses in-kernel eBPF helper programs to monitor events mainly related to
    syscalls from userspace programs in a pod. The eBPF programs are run by
    the kernel and gather the log data. Inspektor Gadget's userspace utilities
    fetch the log data from ring buffers and display it. What eBPF programs are
    and how Inspektor Gadget uses them is briefly explained in the architecture
    document:
    https://github.com/inspektor-gadget/inspektor-gadget/blob/main/docs/architecture.md
  caveats: |
    Inspektor Gadget needs to be deployed to each node:

    $ kubectl gadget deploy

    Read the documentation available at https://github.com/inspektor-gadget/inspektor-gadget
    to get more information about the server side installation process.
  platforms:
  - selector:
      matchLabels:
        os: linux
        arch: amd64
    {{addURIAndSha "https://github.com/inspektor-gadget/inspektor-gadget/releases/download/{{ .TagName }}/kubectl-gadget-linux-amd64-{{ .TagName }}.tar.gz" .TagName }}
    bin: kubectl-gadget

  - selector:
      matchLabels:
        os: linux
        arch: arm64
    {{addURIAndSha "https://github.com/inspektor-gadget/inspektor-gadget/releases/download/{{ .TagName }}/kubectl-gadget-linux-arm64-{{ .TagName }}.tar.gz" .TagName }}
    bin: kubectl-gadget

  - selector:
      matchLabels:
        os: darwin
        arch: amd64
    {{addURIAndSha "https://github.com/inspektor-gadget/inspektor-gadget/releases/download/{{ .TagName }}/kubectl-gadget-darwin-amd64-{{ .TagName }}.tar.gz" .TagName }}
    bin: kubectl-gadget

  - selector:
      matchLabels:
        os: darwin
        arch: arm64
    {{addURIAndSha "https://github.com/inspektor-gadget/inspektor-gadget/releases/download/{{ .TagName }}/kubectl-gadget-darwin-arm64-{{ .TagName }}.tar.gz" .TagName }}
    bin: kubectl-gadget

  - selector:
      matchLabels:
        os: windows
        arch: amd64
    {{addURIAndSha "https://github.com/inspektor-gadget/inspektor-gadget/releases/download/{{ .TagName }}/kubectl-gadget-windows-amd64-{{ .TagName }}.tar.gz" .TagName }}
    bin: kubectl-gadget.exe
